<!-- start module contents -->
<script type="text/javascript" src="include/prototype.js"></script>
<script type="text/javascript">
<!--
function delconfirm(fm) {
	confirm("<{$smarty.const._MD_CATEGORY}>"+fm.cname.value+"<{$smarty.const._MD_CATEGORY_DELCONFIRM}>");
}

function inputchk(fm) {
	if(fm.cname.value == ""){
		alert("<{$smarty.const._MD_CATEGORY_REQ}>");
		return false;
	}else{
		return true;
	}
}
//-->
</script>

<{if $mod_config.show_breadcrumbs}>
<div id="d3d_breadcrumbs">
	<a href="<{$xoops_url}>/">TOP</a>
	<{foreach from=$xoops_breadcrumbs key="i" item="item"}>
	    <{* if $i!=0 *}>
		&nbsp;>&nbsp;
		<{if $item.url}>
			<a href="<{$item.url}>"><{$item.name}></a>
		<{else}>
			<{$item.name}>
		<{/if}>
	    <{* /if *}>
	<{/foreach}>
</div><br/>
<{/if}>

<{if $mod_config.use_name==1 && $yd_name}><{$yd_name}>
	<{else}><{$yd_uname}>
	<{/if}><{$smarty.const._MD_DIARY_PERSON}><br/>
<br/>


<form method='POST' action='index.php?page=editcategory' onsubmit="return inputchk(this)">
<table class="outer" cellspacing="1">
<tr>
<th align="left" colspan=2>
<{$smarty.const._MD_CATEGORY_ADD_DO}>
</th>
</tr><tr>
<td class="head" style="white-space:nowrap;width:100px;"><{$smarty.const._MD_CATEGORY}></td>
<td><{$smarty.const._MD_CATEGORY_ADDREQ}><br />
<input type="text" name="cname" size="20" /><input type="submit" name="createsub" value="<{$smarty.const._MD_SUBMIT}>" /></td>
</tr>
</table>
</form>

<br />

<{if $yd_category|@count>0}>

<table class="outer" cellspacing="1">
<tr>
<th align="left" colspan=4>
<{$smarty.const._MD_CATEGORY_EDIT}>
</th>
</tr>

<tr><td class="head" ><{$smarty.const._MD_CATEGORY_ORDER}></td><td class="head" >SUB</td><td class="head"  colspan=2><{$smarty.const._MD_CATEGORY_SWAPDSC}><br /><br />
</td></tr>
<tr>
<{section name=num loop=$yd_category}>
<tr>
<form method='POST' action='index.php?page=editcategory' style="display:inline;">
<td style="text-align:left;">
<input type="text" name="corder" size="3" value="<{$yd_category[num].corder}>"/>
</td>
<td style="text-align:center;">
<input type="checkbox" name="subcat" value="1" <{if $yd_category[num].subcat==1 }>checked<{/if}> />
</td>
<td>
<input type="text" name="cname" size="20" value="<{$yd_category[num].cname}>"/>
<input type="hidden" name="cid" value="<{$yd_category[num].cid}>" />
<input type="submit" name="editsub" value="<{$smarty.const._MD_SUBMIT}>" />
</td>
</form>

<td>
<form method='POST' action='index.php?page=editcategory' style="display:inline;">
<input type="hidden" name="cid" value="<{$yd_category[num].cid}>" />
<input type="submit" name="delsub" value="<{$smarty.const._MD_T_DEL}>" />
</form>
<{if $yd_use_open_cat}>
<form method='POST' action='index.php?page=editcat_config' style="display:inline;">
<input type="hidden" name="cid" value="<{$yd_category[num].cid}>" />
<input type="submit" name="dispsub" value="<{$smarty.const._MD_CAT_CONF}>" />
</form>

<{if $yd_category[num].blogtype > 0}>
<a href="<{$yd_category[num].blogurl}>" target="_blank">
<img src="<{$xoops_url}>/modules/<{$mydirname}>/images/door_out.gif" border=0 style="vertical-align:middle;" /></a> 
<{/if}>
<{if $yd_category[num].openarea >0}><img src="images/open<{$yd_category[num].openarea}>.gif" border=0 /><{/if}>
<{/if}>

</td>
</tr>
<{/section}>

</table>
<{/if}>
<br />

<{if $yd_isadmin}>
<hr />
<p><{$smarty.const._MD_CATEGORY_COMMON}></p>

<form method='POST' action='index.php?page=editcategory' onsubmit="return inputchk(this)">
<table class="outer" cellspacing="1">
<tr>
<th align="left" colspan=2>
<{$smarty.const._MD_CATEGORY_ADD_DO}>
</th>
</tr><tr>
<td class="head" style="white-space:nowrap;width:100px;"><{$smarty.const._MD_CATEGORY}></td>
<td><{$smarty.const._MD_CATEGORY_ADDREQ}><br />
<input type="text" name="cname" size="20" />
<input type="hidden" name="common_cat" value="1" />
<input type="submit" name="createsub" value="<{$smarty.const._MD_SUBMIT}>" /></td>
</tr>
</table>
</form>
<br />

<{if $yd_common_cat|@count>0}>
<table class="outer" cellspacing="1">
<tr>
<th align="left" colspan=4>
<{$smarty.const._MD_CATEGORY_EDIT}>
</th>
</tr>

<tr><td class="head" ><{$smarty.const._MD_CATEGORY_ORDER}></td><td class="head" >SUB</td><td class="head"  colspan=2><{$smarty.const._MD_CATEGORY_SWAPDSC}><br /><br />
</td></tr>

<tr>
<{section name=num loop=$yd_common_cat}>
<tr>
<form method='POST' action='index.php?page=editcategory' style="display:inline;">
<td style="text-align:left;">
<input type="text" name="corder" size="3" value="<{$yd_common_cat[num].corder}>"/>
</td>
<td style="text-align:center;">
<input type="hidden" name="common_cat" value="1" />
<input type="checkbox" name="subcat" value="1" <{if $yd_common_cat[num].subcat==1 }>checked<{/if}> />
</td>
<td>
<input type="text" name="cname" size="20" value="<{$yd_common_cat[num].cname}>"/>
<input type="hidden" name="cid" value="<{$yd_common_cat[num].cid}>" />
<input type="submit" name="editsub" value="<{$smarty.const._MD_SUBMIT}>" />
</td>
</form>

<td>
<form method='POST' action='index.php?page=editcategory' style="display:inline;">
<input type="hidden" name="common_cat" value="1" />
<input type="hidden" name="cid" value="<{$yd_common_cat[num].cid}>" />
<input type="submit" name="delsub" value="<{$smarty.const._MD_T_DEL}>" />
</form>

<{if $yd_use_open_cat}>
<form method='POST' action='index.php?page=editcat_config' style="display:inline;">
<input type="hidden" name="common_cat" value="1" />
<input type="hidden" name="cid" value="<{$yd_common_cat[num].cid}>" />
<input type="submit" name="dispsub" value="<{$smarty.const._MD_CAT_CONF}>" />
</form>

<{if $yd_common_cat[num].blogtype > 0}>
<a href="<{$yd_common_cat[num].blogurl}>" target="_blank">
<img src="<{$xoops_url}>/modules/<{$mydirname}>/images/door_out.gif" border=0 style="vertical-align:middle;" /></a> 
<{/if}>
<{if $yd_common_cat[num].openarea >0}><img src="images/open<{$yd_common_cat[num].openarea}>.gif" border=0 /><{/if}>
<{/if}>

</td>
</tr>
<{/section}>

</table>
<{/if}>
<{/if}>

<{if $debug_time}>
 <{foreach from=$debug_time item="debug"}>
	<{$debug.time}>:<{$debug.caller}><br />
 <{/foreach}>
<{/if}>
